package com.example.activitys;

import com.example.tracontroller.R;
import com.example.tracontroller.R.id;
import com.example.tracontroller.R.layout;
import com.example.tracontroller.R.menu;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.ImageButton;
import android.view.View.OnClickListener;

public class MainBtnActivity extends Activity {

	private ImageButton drvLisBtn;
	private ImageButton todayEdit;
	private ImageButton illegalStopCar;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main_btn);
		findViewAndButtons();
		drvLisBtn.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MainBtnActivity.this, InputDrivinglicenseActivity.class);
				startActivity(intent);
			}
		});
		todayEdit.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MainBtnActivity.this, TodayRecordList.class);
				startActivity(intent);
			}
		});
		illegalStopCar.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MainBtnActivity.this, IllegalStopDrivingTakePhoto.class);
				startActivity(intent);
			}
		});
	}
	@Override
	public void onBackPressed()
	{
		Intent intent = new Intent();
		intent.setClass(MainBtnActivity.this, LoginActivity.class);
		startActivity(intent);
		this.finish();
	}
	private void findViewAndButtons() {
		// TODO Auto-generated method stub
		drvLisBtn = (ImageButton) findViewById(R.id.jsz_btn);
		todayEdit = (ImageButton) findViewById(R.id.todayedit);
		illegalStopCar = (ImageButton) findViewById(R.id.weizhangbtn);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main_btn, menu);
		return true;
	}

}
